<?php

use Illuminate\Database\Seeder;

class UserAddressSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $id = \App\User::first()['id'];

        $address = [
            ['user_id'=>$id,'province'=>"北京市",'city'=> "市辖区",'district'=> "东城区",'address'=> "东城区",'zip'=>221411,'contact_phone'=>mt_rand(12,13),'contact_name'=>mt_rand(10,20),'last_used_at'=>time()],
            ['user_id'=>$id,'province'=>"河北省",'city'=> "石家庄市",'district'=> "东城区",'address'=> "长安区",'zip'=>221411,'contact_phone'=>mt_rand(12,13),'contact_name'=>mt_rand(10,20),'last_used_at'=>time()],
            ['user_id'=>$id,'province'=>"江苏省",'city'=> "南京市",'district'=> "东城区",'address'=> "浦口区",'zip'=>221411,'contact_phone'=>mt_rand(12,13),'contact_name'=>mt_rand(10,20),'last_used_at'=>time()],
            ['user_id'=>$id,'province'=>"江苏省",'city'=> "苏州市",'district'=> "东城区",'address'=> "相城区",'zip'=>221411,'contact_phone'=>mt_rand(12,13),'contact_name'=>mt_rand(10,20),'last_used_at'=>time()],
            ['user_id'=>$id,'province'=>"广东省",'city'=> "深圳市",'district'=> "东城区",'address'=> "福田区",'zip'=>221411,'contact_phone'=>mt_rand(12,13),'contact_name'=>mt_rand(10,20),'last_used_at'=>time()],
        ];
        foreach ($address as $k=>$v) {
            \App\Model\UserAddress::create($v);
        }

    }
}
